<?php
namespace pinduoduo\Request;

use pinduoduo\AbstractInterface\Request;

class PddDdkOauthRpPromUrlGenerateRequest extends Request
{
    /**
     * 生成营销工具推广链接
     * @var string
     */
    private $type = 'pdd.ddk.oauth.rp.prom.url.generate';

    /**
     * 初始金额（单位分），有效金额枚举值：300、500、700、1100和1600，默认300
     * @var
     */
    private $amount;

    /**
     * 营销工具类型，必填：-1-活动列表，0-红包(需申请推广权限)，2–新人红包，3-刮刮卡，5-员工内购，10-生成绑定备案链接，12-砸金蛋，14-千万补贴B端页面，15-充值中心B端页面，16-千万补贴C端页面，17-千万补贴投票页面，23-超级红包，24-礼金全场N折活动B端页面，27-带货赢千万，28-满减券活动B端页面，29-满减券活动C端页面，30-免单B端页面，31-免单C端页面，32-转盘得现金B端页面，33-转盘得现金C端页面，34-千万神券C端页面，35-千万神券B端页面，37-超级红包B端推品页；红包推广权限申请流程链接：https://jinbao.pinduoduo.com/qa-system?questionId=289
     * @var
     */
    private $channelType;

    /**
     * 自定义参数，为链接打上自定义标签；自定义参数最长限制64个字节；格式为： {"uid":"11111","sid":"22222"} ，其中 uid 用户唯一标识，可自行加密后传入，每个用户仅且对应一个标识，必填； sid 上下文信息标识，例如sessionId等，非必填。该json字符串中也可以加入其他自定义的key。（如果使用GET请求，请使用URLEncode处理参数）
     * @var
     */
    private $customParameters;

    /**
     * 一元购自定义参数，json格式，例如:{"goods_sign":"Y9b2_0uSWMFPGSaVwvfZAlm_y2ADLWZl_JQ7UYaS80K"}
     * @var
     */
    private $diyOneYuanParam;

    /**
     * 红包自定义参数，json格式
     * @var
     */
    private $diyRedPacketParam;

    /**
     * 超级红包自定义参数，json格式
     * @var
     */
    private $diySpRedPacketParam;

    /**
     * 是否生成qq小程序
     * @var
     */
    private $generateQqApp;

    /**
     * 是否返回 schema URL
     * @var
     */
    private $generateSchemaUrl;

    /**
     * 是否生成短链接。true-是，false-否，默认false
     * @var
     */
    private $generateShortUrl;

    /**
     * 是否生成拼多多福利券微信小程序推广信息
     * @var
     */
    private $generateWeApp;

    /**
     * 推广位列表，长度最大为1，例如：["60005_612"]。活动页生链要求传入授权备案信息，不支持批量生链。
     * @var
     */
    private $pIdList;

    /**
     * 刮刮卡指定金额（单位分），可指定2-100元间数值，即有效区间为：[200,10000]
     * @var
     */
    private $scratchCardAmount;

    /**
     * 招商多多客ID
     * @var
     */
    private $zsduoId;

    public function setType($type)
    {
        $this->type = $type;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setAmount($amount)
    {
        $this->amount = $amount;
    }

    public function getAmount()
    {
        return $this->amount;
    }

    public function setChannelType($channelType)
    {
        $this->channelType = $channelType;
    }

    public function getChannelType()
    {
        return $this->channelType;
    }

    public function setCustomParameters($customParameters)
    {
        $this->customParameters = $customParameters;
    }

    public function getCustomParameters()
    {
        return $this->customParameters;
    }

    public function setDiyOneYuanParam($diyOneYuanParam)
    {
        $this->diyOneYuanParam = $diyOneYuanParam;
    }

    public function getDiyOneYuanParam()
    {
        return $this->diyOneYuanParam;
    }

    public function setDiyRedPacketParam($diyRedPacketParam)
    {
        $this->diyRedPacketParam = $diyRedPacketParam;
    }

    public function getDiyRedPacketParam()
    {
        return $this->diyRedPacketParam;
    }

    public function setDiySpRedPacketParam($diySpRedPacketParam)
    {
        $this->diySpRedPacketParam = $diySpRedPacketParam;
    }

    public function getDiySpRedPacketParam()
    {
        return $this->diySpRedPacketParam;
    }

    public function setGenerateQqApp($generateQqApp)
    {
        $this->generateQqApp = $generateQqApp;
    }

    public function getGenerateQqApp()
    {
        return $this->generateQqApp;
    }

    public function setGenerateSchemaUrl($generateSchemaUrl)
    {
        $this->generateSchemaUrl = $generateSchemaUrl;
    }

    public function getGenerateSchemaUrl()
    {
        return $this->generateSchemaUrl;
    }

    public function setGenerateShortUrl($generateShortUrl)
    {
        $this->generateShortUrl = $generateShortUrl;
    }

    public function getGenerateShortUrl()
    {
        return $this->generateShortUrl;
    }

    public function setGenerateWeApp($generateWeApp)
    {
        $this->generateWeApp = $generateWeApp;
    }

    public function getGenerateWeApp()
    {
        return $this->generateWeApp;
    }

    public function setPIdList($pIdList)
    {
        $this->pIdList = $pIdList;
    }

    public function getPIdList()
    {
        return $this->pIdList;
    }

    public function setScratchCardAmount($scratchCardAmount)
    {
        $this->scratchCardAmount = $scratchCardAmount;
    }

    public function getScratchCardAmount()
    {
        return $this->scratchCardAmount;
    }

    public function setZsduoId($zsduoId)
    {
        $this->zsduoId = $zsduoId;
    }

    public function getZsduoId()
    {
        return $this->zsduoId;
    }

    public function getParams()
    {
        $params = [
            'type'                    => $this->type,
            'amount'                  => $this->amount,
            'channel_type'            => $this->channelType,
            'custom_parameters'       => $this->customParameters,
            'diy_one_yuan_param'      => $this->diyOneYuanParam,
            'diy_red_packet_param'    => $this->diyRedPacketParam,
            'diy_sp_red_packet_param' => $this->diySpRedPacketParam,
            'generate_qq_app'         => $this->generateQqApp,
            'generate_schema_url'     => $this->generateSchemaUrl,
            'generate_short_url'      => $this->generateShortUrl,
            'generate_we_app'         => $this->generateWeApp,
            'p_id_list'               => $this->pIdList,
            'scratch_card_amount'     => $this->scratchCardAmount,
            'zs_duo_id'               => $this->zsduoId,
        ];
        $buildParams = [];
        foreach ($params as $key => $value) if ($value === 0) $buildParams[$key] = $value;
        return array_merge(array_filter($params), $buildParams);
    }
}
